/** @file               sw_list2.h
 *  @copyright          Copyright (C) 2006-2026 flyfish (tenggui_fu@126.com)
 *  @brief              This file is part of the swallow library
 *  @author             $Author: flyfish $
 *  @version            $Rev: 385 $
 *  @date               $Date: 2016-12-22 00:12:05 +0800 (周四, 22 12月 2016) $
 */
#ifndef __SW_LIST2_H__
#define __SW_LIST2_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef SW_VOID                 *SW_LIST2;
typedef SW_VOID                 *SW_NODE2;

#define SW_INVALID_LIST2        NULL
#define SW_INVALID_NODE2        NULL

SW_API SW_RET SW_InitList2API(SW_VOID);
SW_API SW_RET SW_RunList2API(SW_VOID);
SW_API SW_RET SW_StopList2API(SW_VOID);
SW_API SW_RET SW_ExitList2API(SW_VOID);
SW_API SW_LIST2 SW_CreateList2(SW_VOID);
SW_API SW_RET SW_DeleteList2(SW_LIST2 list2);
SW_API SW_RET SW_LockList2(SW_LIST2 list2);
SW_API SW_RET SW_UnlockList2(SW_LIST2 list2);
SW_API SW_NODE2 SW_CreateNode2(const SW_VOID *pData, SW_UINT32 dataLen);
SW_API SW_RET SW_DeleteNode2(SW_NODE2 node2);
SW_API SW_RET SW_LockNode2List2(SW_NODE2 node2);
SW_API SW_RET SW_UnlockNode2List2(SW_NODE2 node2);
SW_API SW_LIST2 SW_GetNode2List2(SW_NODE2 node2);
SW_API SW_VOID *SW_GetNode2DataPtr(SW_NODE2 node2);
SW_API SW_UINT32 SW_GetNode2DataLen(SW_NODE2 node2);
SW_API SW_RET SW_GetNode2Data(SW_NODE2 node2, SW_VOID *pData, SW_UINT32 *pDataLen);
SW_API SW_RET SW_SetNode2Data(SW_NODE2 node2, const SW_VOID *pData, SW_UINT32 dataLen);
SW_API SW_NODE2 SW_GetFirstNode2(SW_LIST2 list2);
SW_API SW_NODE2 SW_GetLastNode2(SW_LIST2 list2);
SW_API SW_NODE2 SW_TakeFirstNode2(SW_LIST2 list2);
SW_API SW_NODE2 SW_TakeLastNode2(SW_LIST2 list2);
SW_API SW_NODE2 SW_GetNStepNode2(SW_NODE2 node2, SW_INT32 step);
SW_API SW_NODE2 SW_GetNthNode2(SW_LIST2 list2, SW_UINT32 index);
SW_API SW_NODE2 SW_GetNextNode2(SW_NODE2 node2);
SW_API SW_NODE2 SW_GetPrevNode2(SW_NODE2 node2);
SW_API SW_UINT32 SW_GetNode2Count(SW_LIST2 list2);
SW_API SW_UINT32 SW_FindNode2(SW_LIST2 list2, SW_NODE2 node2);
SW_API SW_RET SW_AddNode2(SW_LIST2 list2, SW_NODE2 node2);
SW_API SW_RET SW_InsertNode2(SW_LIST2 list2, SW_NODE2 prevNode2, SW_NODE2 node2);
SW_API SW_RET SW_RemoveNode2(SW_LIST2 list2, SW_NODE2 node2);
SW_API SW_RET SW_ConcatList2(SW_LIST2 dstList2, SW_LIST2 addList2);
SW_API SW_RET SW_ExtractList2(SW_LIST2 srcList2, SW_NODE2 startNode2, SW_NODE2 endNode2, SW_LIST2 *pDstList2);

#ifdef __cplusplus
}
#endif

#endif
